const person = {
  name: 'abc',
  age: 20
}

const personProxy = new Proxy(person, {
  deleteProperty(target, property) {
    console.log(`delete:`, target, property);
    delete target[property]
  }
})

delete personProxy.age;
console.log(person)

//------------------------------------------
const list = [];
const listProxy = new Proxy(list, {
  set(target, property, value) {
    console.log(`set:`, target, property, value)
    target[property] = value;
    return true;//设置成功
  }
});
listProxy.push(100)